//
//  IMIPlayAudio.h
//  MiHome
//
//  Created by 阎超 on 11/05/2017.
//  Copyright © 2017 小米移动软件. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AudioToolbox/AudioFile.h>

#define NUM_BUFFERS 3

@interface IMIPlayAudio : NSObject

//定义队列为实例属性
@property AudioQueueRef queue;

//定义缓存数据读取方法
- (void)audioQueueOutputWithQueue:(AudioQueueRef)audioQueue
                      queueBuffer:(AudioQueueBufferRef)audioQueueBuffer;
- (UInt32)readPacketsIntoBuffer:(AudioQueueBufferRef)buffer;
- (void)addAudioBuffer:(NSData *)bufferdata;
- (void)startPlay:(NSInteger)sampleRate withChannel:(NSInteger)audioChannel;
- (void)stopPlay;
- (void)flushAudio;
- (void)reset;
- (void)setGain:(Float32)gain;

@end
